echo '进入项目根目录'
PROJECT_DIR=/www/wwwroot/center.alvinsite.top
cd ${PROJECT_DIR}

echo '激活 Python 虚拟环境'
source DataCenter_venv/bin/activate

echo '重启 Django'
uwsgi --reload /var/run/django/DataCenter-master.pid

echo '重启 celery-worker-1'
# 启动celery-worker1
celery multi restart worker1 -A DataManagement -l info --logfile=/var/log/celery/celery-worker-1.log --pidfile=/var/run/celery/celery-worker-1.pid

echo '重启 celery-beat'
# 启动celery-worker1
celery multi restart beat -A DataManagement -l info --logfile=/var/log/celery/celery-beat.log --pidfile=/var/run/celery/celery-beat.pid

echo '退出 Python 虚拟环境'
deactivate

echo '重启完成'
